﻿using AppFramework.DinosaursParkMes.ProductionPlanningModel;
using Castle.MicroKernel.SubSystems.Conversion;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Text;
using System.Xml.Linq;
using AppFramework.DinosaursParkMes.ProductWork.Dto;

namespace AppFramework.DinosaursParkMes.ProductionPlanning.Dto
{
    public class DetailsProductionPlanningDTO
    {
        /// <summary>
        /// 计划编号
        /// </summary>
        public string Planningnumber { get; set; }

        /// <summary>
        /// 计划名称
        /// </summary>
        public string Planningname { get; set; }

        /// <summary>
        /// 来源类型
        /// </summary>
        public string Sourcetype { get; set; }

        /// <summary>
        /// 订单编号
        /// </summary>
        public string Ordernumber { get; set; }

        /// <summary>
        /// 成品名称
        /// </summary>
        public string Finishedname { get; set; }

        /// <summary>
        /// 成品编号
        /// </summary>
        public string Finishednumber { get; set; }

        /// <summary>
        /// 规格型号
        /// </summary>
        public string Specificationversion { get; set; }

        /// <summary>
        /// 成品l类型
        /// </summary>
        public string Finishedtype { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        public string Unit { get; set; }

        /// <summary>
        /// 计划数量
        /// </summary>
        public int? Planningcount { get; set; }

        /// <summary>
        /// 开工时间
        /// </summary>
        public DateTime? Starttime { get; set; } = DateTime.Now;

        /// <summary>
        /// 完工时间
        /// </summary>
        public DateTime? Timeofcompletion { get; set; }

        /// <summary>
        /// 需求日期
        /// </summary>
        public DateTime? Demanddate { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }
        /// <summary>
        /// 软删除
        /// </summary>
        public bool IsDeleted { get; set; }
        /// <summary>
        /// 生产计划状态
        /// </summary>
        public string  State { get; set; }
        /// <summary>
        /// BOM编号
        /// </summary>
        public string BOMNumber { get; set; }
        /// <summary>
        /// 版本号
        /// </summary>
        public string Versionnumber { get; set; }

        public List<ProductionPlanningAccessory> AccessoryChildren { get; set; }
        public List<MaterialProductMessage> MaterialProductChildren { get; set; }
        public List<MaterialMessage> MaterialChildren { get; set; }
        public List<ProductMessage> ProductChildren { get; set; }
        public List<WorkOrderMessage> WorkOrderChildren { get; set; }
    }
    public class WorkOrderMessage
    {
        /// <summary>
        /// 工单编
        /// </summary>
        public string WorkOrderNumber { get; set; }
        /// <summary>
        /// 工单名称
        /// </summary>
        public string WorkOrderName { get; set; }
        /// <summary>
        /// 工单进度
        /// </summary>
        public string WorkOrderSchedule { get; set; }
        /// <summary>
        /// 关联计划
        /// </summary>
        public string RelevanceExplain { get; set; }
        /// <summary>
        /// 产品名称
        /// </summary>
        public string ProductName { get; set; }
        /// <summary>
        /// 产品编号
        /// </summary>
        public string ProductNumber { get; set; }
        /// <summary>
        /// 规格型号
        /// </summary>
        public string Specification { get; set; }
        /// <summary>
        /// 产品类型
        /// </summary>
        public string ProductType { get; set; }
        /// <summary>
        /// 单位
        /// </summary>
        public string Unit { get; set; }
        /// <summary>
        /// 需求日期
        /// </summary>
        public DateTime? DemandDate { get; set; }
        /// <summary>
        /// 计划数量
        /// </summary>
        public int? ExplainNum { get; set; }
        /// <summary>
        /// 实际生产数量
        /// </summary>
        public int? AccomplishNum { get; set; }
        /// <summary>
        /// 计划开工时间
        /// </summary>
        public DateTime? ExplainStartDate { get; set; }
        /// <summary>
        /// 计划完工时间
        /// </summary>
        public DateTime? ExplainEndDate { get; set; }
        /// <summary>
        /// 实际开工时间
        /// </summary>
        public DateTime? PracticalStartDate { get; set; }
        /// <summary>
        /// 实际完工时间
        /// </summary>
        public DateTime? PracticalEndDate { get; set; }
        /// <summary>
        /// 状态
        /// </summary>
        public string   State { get; set; } 
    }
    public class ProductionPlanningAccessory
        {
            /// <summary>
            /// 图片名称
            /// </summary>
            public string Filename { get; set; }
            /// <summary>
            /// 图片路径
            /// </summary>
            public string Filepath { get; set; }
        }
    public class MaterialProductMessage
        {
        /// <summary>
        /// 产品编号
        /// </summary>
        public string Productid { get; set; }
        /// <summary>
        /// 产品名称
        /// </summary>
        public string Productname { get; set; }
        /// <summary>
        /// 规格型号
        /// </summary>
        public string Specification { get; set; }
        /// <summary>
        /// 单位;字典
        /// </summary>
        public string Units { get; set; }
        /// <summary>
        /// BOM编号
        /// </summary>
        public string Numberbom { get; set; }
        /// <summary>
        /// 版本号
        /// </summary>
        public string Versionnumber { get; set; }
        /// <summary>
        /// 使用量
        /// </summary>
        public int Usageamount { get; set; }
        /// <summary>
        /// 使用比例
        /// </summary>
        public int Useratio { get; set; }
        public List<MaterialProductMessage> children { get; set; }
    }
    public class MaterialMessage
    {
        /// <summary>
        /// 物料编号
        /// </summary  
        public string Materialnumber { get; set; }
        /// <summary>
        /// 物料名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 规格型号
        /// </summary>
        public string Specificationsversion { get; set; }
        /// <summary>
        /// 单位
        /// </summary>
        public string Unit { get; set; }
        /// <summary>
        /// 物料类型
        /// </summary>
        public string Materialtype { get; set; }
        /// <summary>
        /// 使用量
        /// </summary>
        public int Usageamount { get; set; }
        /// <summary>
        /// 预计使用量
        /// </summary>
        public int PracticalUsageamount { get; set; }

    }
    public class ProductMessage
    {
        /// <summary>
        /// 产品编号
        /// </summary>
        public string Productid { get; set; }
        /// <summary>
        /// 产品名称
        /// </summary>
        public string Productname { get; set; }
        /// <summary>
        /// 规格型号
        /// </summary>
        public string Specification { get; set; }
        /// <summary>
        /// 单位;字典
        /// </summary>
        public string Units { get; set; }
        /// <summary>
        /// 产品类型;字典
        /// </summary>
        public string Producttype { get; set; }
        /// <summary>
        /// 使用量
        /// </summary>
        public int Usageamount { get; set; }
        /// <summary>
        /// 预计使用量
        /// </summary>
        public int PracticalUsageamount { get; set; }
    }
}
